Optimal. Leaf size=353 \[ -\frac {(d e-c f) (a d f (3+m)-b (d e+c f (2+m))) (a+b x)^{1+m} (c+d x)^{-3-m}}{b d^2 (b c-a d) (3+m)}+\frac {\left (a^2 d^2 f^2 \left (6+5 m+m^2\right )-2 a b d f (3+m) (d e+c f (1+m))+b^2 \left (2 d^2 e^2+2 c d e f (1+m)+c^2 f^2 \left (2+3 m+m^2\right )\right )\right ) (a+b x)^{1+m} (c+d x)^{-2-m}}{b d^2 (b c-a d)^2 (2+m) (3+m)}+\frac {\left (a^2 d^2 f^2 \left (6+5 m+m^2\right )-2 a b d f (3+m) (d e+c f (1+m))+b^2 \left (2 d^2 e^2+2 c d e f (1+m)+c^2 f^2 \left (2+3 m+m^2\right )\right )\right ) (a+b x)^{1+m} (c+d x)^{-1-m}}{d^2 (b c-a d)^3 (1+m) (2+m) (3+m)}-\frac {f (a+b x)^{1+m} (c+d x)^{-3-m} (e+f x)}{b d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.23, antiderivative size = 351, normalized size of antiderivative = 0.99, number of steps
used = 4, number of rules used = 4, integrand size = 26, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.154, Rules used = {92, 80, 47, 37}
\begin {gather*} \frac {(a+b x)^{m+1} (c+d x)^{-m-2} \left (a^2 d^2 f^2 \left (m^2+5 m+6\right )-2 a b d f (m+3) (c f (m+1)+d e)+b^2 \left (c^2 f^2 \left (m^2+3 m+2\right )+2 c d e f (m+1)+2 d^2 e^2\right )\right )}{b d^2 (m+2) (m+3) (b c-a d)^2}+\frac {(a+b x)^{m+1} (c+d x)^{-m-1} \left (a^2 d^2 f^2 \left (m^2+5 m+6\right )-2 a b d f (m+3) (c f (m+1)+d e)+b^2 \left (c^2 f^2 \left (m^2+3 m+2\right )+2 c d e f (m+1)+2 d^2 e^2\right )\right )}{d^2 (m+1) (m+2) (m+3) (b c-a d)^3}+\frac {(a+b x)^{m+1} (d e-c f) (c+d x)^{-m-3} (-a d f (m+3)+b c f (m+2)+b d e)}{b d^2 (m+3) (b c-a d)}-\frac {f (e+f x) (a+b x)^{m+1} (c+d x)^{-m-3}}{b d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 37
Rule 47
Rule 80
Rule 92
Rubi steps
\begin {align*} \int (a+b x)^m (c+d x)^{-4-m} (e+f x)^2 \, dx &=-\frac {f (a+b x)^{1+m} (c+d x)^{-3-m} (e+f x)}{b d}-\frac {\int (a+b x)^m (c+d x)^{-4-m} \left (-b e (d e+c f (1+m))-a f (c f-d e (3+m))-(b c-a d) f^2 (2+m) x\right ) \, dx}{b d}\\ &=\frac {(d e-c f) (b d e+b c f (2+m)-a d f (3+m)) (a+b x)^{1+m} (c+d x)^{-3-m}}{b d^2 (b c-a d) (3+m)}-\frac {f (a+b x)^{1+m} (c+d x)^{-3-m} (e+f x)}{b d}+\frac {\left ((b c-a d) f^2 (2+m) (a d (-3-m)+b c (1+m))-2 b d (-b e (d e+c f (1+m))-a f (c f-d e (3+m)))\right ) \int (a+b x)^m (c+d x)^{-3-m} \, dx}{b d^2 (-b c+a d) (-3-m)}\\ &=\frac {(d e-c f) (b d e+b c f (2+m)-a d f (3+m)) (a+b x)^{1+m} (c+d x)^{-3-m}}{b d^2 (b c-a d) (3+m)}+\frac {\left (a^2 d^2 f^2 \left (6+5 m+m^2\right )-2 a b d f (3+m) (d e+c f (1+m))+b^2 \left (2 d^2 e^2+2 c d e f (1+m)+c^2 f^2 \left (2+3 m+m^2\right )\right )\right ) (a+b x)^{1+m} (c+d x)^{-2-m}}{b d^2 (b c-a d)^2 (2+m) (3+m)}-\frac {f (a+b x)^{1+m} (c+d x)^{-3-m} (e+f x)}{b d}+\frac {\left (a^2 d^2 f^2 \left (6+5 m+m^2\right )-2 a b d f (3+m) (d e+c f (1+m))+b^2 \left (2 d^2 e^2+2 c d e f (1+m)+c^2 f^2 \left (2+3 m+m^2\right )\right )\right ) \int (a+b x)^m (c+d x)^{-2-m} \, dx}{d^2 (b c-a d)^2 (2+m) (3+m)}\\ &=\frac {(d e-c f) (b d e+b c f (2+m)-a d f (3+m)) (a+b x)^{1+m} (c+d x)^{-3-m}}{b d^2 (b c-a d) (3+m)}+\frac {\left (a^2 d^2 f^2 \left (6+5 m+m^2\right )-2 a b d f (3+m) (d e+c f (1+m))+b^2 \left (2 d^2 e^2+2 c d e f (1+m)+c^2 f^2 \left (2+3 m+m^2\right )\right )\right ) (a+b x)^{1+m} (c+d x)^{-2-m}}{b d^2 (b c-a d)^2 (2+m) (3+m)}+\frac {\left (a^2 d^2 f^2 \left (6+5 m+m^2\right )-2 a b d f (3+m) (d e+c f (1+m))+b^2 \left (2 d^2 e^2+2 c d e f (1+m)+c^2 f^2 \left (2+3 m+m^2\right )\right )\right ) (a+b x)^{1+m} (c+d x)^{-1-m}}{d^2 (b c-a d)^3 (1+m) (2+m) (3+m)}-\frac {f (a+b x)^{1+m} (c+d x)^{-3-m} (e+f x)}{b d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.28, size = 286, normalized size = 0.81 \begin {gather*} -\frac {(a+b x)^{1+m} (c+d x)^{-3-m} \left (b^2 \left (2 d^2 e^2 x^2+2 c d e x (e (3+m)+f (1+m) x)+c^2 \left (e^2 \left (6+5 m+m^2\right )+2 e f \left (3+4 m+m^2\right ) x+f^2 \left (2+3 m+m^2\right ) x^2\right )\right )-2 a b \left (c^2 f (e (3+m)+f (1+m) x)+d^2 e x (e (1+m)+f (3+m) x)+c d \left (e^2 \left (3+4 m+m^2\right )+2 e f \left (5+4 m+m^2\right ) x+f^2 \left (3+4 m+m^2\right ) x^2\right )\right )+a^2 \left (2 c^2 f^2+2 c d f (e (1+m)+f (3+m) x)+d^2 \left (e^2 \left (2+3 m+m^2\right )+2 e f \left (3+4 m+m^2\right ) x+f^2 \left (6+5 m+m^2\right ) x^2\right )\right )\right )}{(-b c+a d)^3 (1+m) (2+m) (3+m)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(740\) vs.
\(2(353)=706\).
time = 0.11, size = 741, normalized size = 2.10
method | result | size |
gosper | \(-\frac {\left (d x +c \right )^{-3-m} \left (b x +a \right )^{1+m} \left (a^{2} d^{2} f^{2} m^{2} x^{2}-2 a b c d \,f^{2} m^{2} x^{2}+b^{2} c^{2} f^{2} m^{2} x^{2}+2 a^{2} d^{2} e f \,m^{2} x +5 a^{2} d^{2} f^{2} m \,x^{2}-4 a b c d e f \,m^{2} x -8 a b c d \,f^{2} m \,x^{2}-2 a b \,d^{2} e f m \,x^{2}+2 b^{2} c^{2} e f \,m^{2} x +3 b^{2} c^{2} f^{2} m \,x^{2}+2 b^{2} c d e f m \,x^{2}+2 a^{2} c d \,f^{2} m x +a^{2} d^{2} e^{2} m^{2}+8 a^{2} d^{2} e f m x +6 a^{2} d^{2} f^{2} x^{2}-2 a b \,c^{2} f^{2} m x -2 a b c d \,e^{2} m^{2}-16 a b c d e f m x -6 a b c d \,f^{2} x^{2}-2 a b \,d^{2} e^{2} m x -6 a b \,d^{2} e f \,x^{2}+b^{2} c^{2} e^{2} m^{2}+8 b^{2} c^{2} e f m x +2 b^{2} c^{2} f^{2} x^{2}+2 b^{2} c d \,e^{2} m x +2 b^{2} c d e f \,x^{2}+2 b^{2} d^{2} e^{2} x^{2}+2 a^{2} c d e f m +6 a^{2} c d \,f^{2} x +3 a^{2} d^{2} e^{2} m +6 a^{2} d^{2} e f x -2 a b \,c^{2} e f m -2 a b \,c^{2} f^{2} x -8 a b c d \,e^{2} m -20 a b c d e f x -2 a b \,d^{2} e^{2} x +5 b^{2} c^{2} e^{2} m +6 b^{2} c^{2} e f x +6 b^{2} c d \,e^{2} x +2 a^{2} c^{2} f^{2}+2 a^{2} c d e f +2 a^{2} d^{2} e^{2}-6 a b \,c^{2} e f -6 a b c d \,e^{2}+6 b^{2} c^{2} e^{2}\right )}{a^{3} d^{3} m^{3}-3 a^{2} b c \,d^{2} m^{3}+3 a \,b^{2} c^{2} d \,m^{3}-b^{3} c^{3} m^{3}+6 a^{3} d^{3} m^{2}-18 a^{2} b c \,d^{2} m^{2}+18 a \,b^{2} c^{2} d \,m^{2}-6 b^{3} c^{3} m^{2}+11 a^{3} d^{3} m -33 a^{2} b c \,d^{2} m +33 a \,b^{2} c^{2} d m -11 b^{3} c^{3} m +6 a^{3} d^{3}-18 a^{2} b c \,d^{2}+18 a \,b^{2} c^{2} d -6 b^{3} c^{3}}\) | \(741\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 1280 vs.
\(2 (357) = 714\).
time = 1.25, size = 1280, normalized size = 3.63 \begin {gather*} \frac {{\left (2 \, a^{3} c^{3} f^{2} + {\left ({\left (b^{3} c^{2} d - 2 \, a b^{2} c d^{2} + a^{2} b d^{3}\right )} f^{2} m^{2} + {\left (3 \, b^{3} c^{2} d - 8 \, a b^{2} c d^{2} + 5 \, a^{2} b d^{3}\right )} f^{2} m + 2 \, {\left (b^{3} c^{2} d - 3 \, a b^{2} c d^{2} + 3 \, a^{2} b d^{3}\right )} f^{2}\right )} x^{4} + {\left ({\left (b^{3} c^{3} - a b^{2} c^{2} d - a^{2} b c d^{2} + a^{3} d^{3}\right )} f^{2} m^{2} + {\left (3 \, b^{3} c^{3} - 7 \, a b^{2} c^{2} d - a^{2} b c d^{2} + 5 \, a^{3} d^{3}\right )} f^{2} m + 2 \, {\left (b^{3} c^{3} - 3 \, a b^{2} c^{2} d + 3 \, a^{2} b c d^{2} + 3 \, a^{3} d^{3}\right )} f^{2}\right )} x^{3} + {\left (12 \, a^{3} c d^{2} f^{2} + {\left (a b^{2} c^{3} - 2 \, a^{2} b c^{2} d + a^{3} c d^{2}\right )} f^{2} m^{2} + {\left (a b^{2} c^{3} - 8 \, a^{2} b c^{2} d + 7 \, a^{3} c d^{2}\right )} f^{2} m\right )} x^{2} + 2 \, {\left (4 \, a^{3} c^{2} d f^{2} - {\left (a^{2} b c^{3} - a^{3} c^{2} d\right )} f^{2} m\right )} x + {\left (2 \, b^{3} d^{3} x^{4} + 6 \, a b^{2} c^{3} - 6 \, a^{2} b c^{2} d + 2 \, a^{3} c d^{2} + 2 \, {\left (4 \, b^{3} c d^{2} + {\left (b^{3} c d^{2} - a b^{2} d^{3}\right )} m\right )} x^{3} + {\left (a b^{2} c^{3} - 2 \, a^{2} b c^{2} d + a^{3} c d^{2}\right )} m^{2} + {\left (12 \, b^{3} c^{2} d + {\left (b^{3} c^{2} d - 2 \, a b^{2} c d^{2} + a^{2} b d^{3}\right )} m^{2} + {\left (7 \, b^{3} c^{2} d - 8 \, a b^{2} c d^{2} + a^{2} b d^{3}\right )} m\right )} x^{2} + {\left (5 \, a b^{2} c^{3} - 8 \, a^{2} b c^{2} d + 3 \, a^{3} c d^{2}\right )} m + {\left (6 \, b^{3} c^{3} + 6 \, a b^{2} c^{2} d - 6 \, a^{2} b c d^{2} + 2 \, a^{3} d^{3} + {\left (b^{3} c^{3} - a b^{2} c^{2} d - a^{2} b c d^{2} + a^{3} d^{3}\right )} m^{2} + {\left (5 \, b^{3} c^{3} - a b^{2} c^{2} d - 7 \, a^{2} b c d^{2} + 3 \, a^{3} d^{3}\right )} m\right )} x\right )} e^{2} + 2 \, {\left ({\left ({\left (b^{3} c d^{2} - a b^{2} d^{3}\right )} f m + {\left (b^{3} c d^{2} - 3 \, a b^{2} d^{3}\right )} f\right )} x^{4} + {\left ({\left (b^{3} c^{2} d - 2 \, a b^{2} c d^{2} + a^{2} b d^{3}\right )} f m^{2} + {\left (5 \, b^{3} c^{2} d - 8 \, a b^{2} c d^{2} + 3 \, a^{2} b d^{3}\right )} f m + 4 \, {\left (b^{3} c^{2} d - 3 \, a b^{2} c d^{2}\right )} f\right )} x^{3} - {\left (a^{2} b c^{3} - a^{3} c^{2} d\right )} f m + {\left ({\left (b^{3} c^{3} - a b^{2} c^{2} d - a^{2} b c d^{2} + a^{3} d^{3}\right )} f m^{2} + 4 \, {\left (b^{3} c^{3} - a b^{2} c^{2} d - a^{2} b c d^{2} + a^{3} d^{3}\right )} f m + 3 \, {\left (b^{3} c^{3} - 3 \, a b^{2} c^{2} d - 3 \, a^{2} b c d^{2} + a^{3} d^{3}\right )} f\right )} x^{2} - {\left (3 \, a^{2} b c^{3} - a^{3} c^{2} d\right )} f + {\left ({\left (a b^{2} c^{3} - 2 \, a^{2} b c^{2} d + a^{3} c d^{2}\right )} f m^{2} + {\left (3 \, a b^{2} c^{3} - 8 \, a^{2} b c^{2} d + 5 \, a^{3} c d^{2}\right )} f m - 4 \, {\left (3 \, a^{2} b c^{2} d - a^{3} c d^{2}\right )} f\right )} x\right )} e\right )} {\left (b x + a\right )}^{m} {\left (d x + c\right )}^{-m - 4}}{6 \, b^{3} c^{3} - 18 \, a b^{2} c^{2} d + 18 \, a^{2} b c d^{2} - 6 \, a^{3} d^{3} + {\left (b^{3} c^{3} - 3 \, a b^{2} c^{2} d + 3 \, a^{2} b c d^{2} - a^{3} d^{3}\right )} m^{3} + 6 \, {\left (b^{3} c^{3} - 3 \, a b^{2} c^{2} d + 3 \, a^{2} b c d^{2} - a^{3} d^{3}\right )} m^{2} + 11 \, {\left (b^{3} c^{3} - 3 \, a b^{2} c^{2} d + 3 \, a^{2} b c d^{2} - a^{3} d^{3}\right )} m} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 3.97, size = 1485, normalized size = 4.21 \begin {gather*} -\frac {x^3\,{\left (a+b\,x\right )}^m\,\left (a^3\,d^3\,f^2\,m^2+5\,a^3\,d^3\,f^2\,m+6\,a^3\,d^3\,f^2-a^2\,b\,c\,d^2\,f^2\,m^2-a^2\,b\,c\,d^2\,f^2\,m+6\,a^2\,b\,c\,d^2\,f^2+2\,a^2\,b\,d^3\,e\,f\,m^2+6\,a^2\,b\,d^3\,e\,f\,m-a\,b^2\,c^2\,d\,f^2\,m^2-7\,a\,b^2\,c^2\,d\,f^2\,m-6\,a\,b^2\,c^2\,d\,f^2-4\,a\,b^2\,c\,d^2\,e\,f\,m^2-16\,a\,b^2\,c\,d^2\,e\,f\,m-24\,a\,b^2\,c\,d^2\,e\,f-2\,a\,b^2\,d^3\,e^2\,m+b^3\,c^3\,f^2\,m^2+3\,b^3\,c^3\,f^2\,m+2\,b^3\,c^3\,f^2+2\,b^3\,c^2\,d\,e\,f\,m^2+10\,b^3\,c^2\,d\,e\,f\,m+8\,b^3\,c^2\,d\,e\,f+2\,b^3\,c\,d^2\,e^2\,m+8\,b^3\,c\,d^2\,e^2\right )}{{\left (a\,d-b\,c\right )}^3\,{\left (c+d\,x\right )}^{m+4}\,\left (m^3+6\,m^2+11\,m+6\right )}-\frac {x^2\,{\left (a+b\,x\right )}^m\,\left (a^3\,c\,d^2\,f^2\,m^2+7\,a^3\,c\,d^2\,f^2\,m+12\,a^3\,c\,d^2\,f^2+2\,a^3\,d^3\,e\,f\,m^2+8\,a^3\,d^3\,e\,f\,m+6\,a^3\,d^3\,e\,f-2\,a^2\,b\,c^2\,d\,f^2\,m^2-8\,a^2\,b\,c^2\,d\,f^2\,m-2\,a^2\,b\,c\,d^2\,e\,f\,m^2-8\,a^2\,b\,c\,d^2\,e\,f\,m-18\,a^2\,b\,c\,d^2\,e\,f+a^2\,b\,d^3\,e^2\,m^2+a^2\,b\,d^3\,e^2\,m+a\,b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left (2\,a^2\,c^2\,f^2+2\,a^2\,c\,d\,e\,f\,m+2\,a^2\,c\,d\,e\,f+a^2\,d^2\,e^2\,m^2+3\,a^2\,d^2\,e^2\,m+2\,a^2\,d^2\,e^2-2\,a\,b\,c^2\,e\,f\,m-6\,a\,b\,c^2\,e\,f-2\,a\,b\,c\,d\,e^2\,m^2-8\,a\,b\,c\,d\,e^2\,m-6\,a\,b\,c\,d\,e^2+b^2\,c^2\,e^2\,m^2+5\,b^2\,c^2\,e^2\,m+6\,b^2\,c^2\,e^2\right )}{{\left (a\,d-b\,c\right )}^3\,{\left (c+d\,x\right )}^{m+4}\,\left (m^3+6\,m^2+11\,m+6\right )}-\frac {b\,d\,x^4\,{\left (a+b\,x\right )}^m\,\left (a^2\,d^2\,f^2\,m^2+5\,a^2\,d^2\,f^2\,m+6\,a^2\,d^2\,f^2-2\,a\,b\,c\,d\,f^2\,m^2-8\,a\,b\,c\,d\,f^2\,m-6\,a\,b\,c\,d\,f^2-2\,a\,b\,d^2\,e\,f\,m-6\,a\,b\,d^2\,e\,f+b^2\,c^2\,f^2\,m^2+3\,b^2\,c^2\,f^2\,m+2\,b^2\,c^2\,f^2+2\,b^2\,c\,d\,e\,f\,m+2\,b^2\,c\,d\,e\,f+2\,b^2\,d^2\,e^2\right )}{{\left (a\,d-b\,c\right )}^3\,{\left (c+d\,x\right )}^{m+4}\,\left (m^3+6\,m^2+11\,m+6\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________